#include <iostream>
#include <memory>
#include <string>

using namespace std;


/*
\ brief:   形状抽象接口
\ author: 清晨与猫鱼
*/
class Shape {
public:
    virtual void draw() = 0;
};


/*
\ brief:   长方形
\ author: 清晨与猫鱼
*/
class Rectangle 
    : public Shape {
public:
    void draw() {
        cout << "Shape: Rectangle" << endl;
    }
};


/*
\ brief:  圆形
\ author: 清晨与猫鱼
*/
class Circle 
    : public Shape {
public:
    void draw() {
        cout << "Shape: Circle" << endl;
    }
};


/*
\ brief:   形状装饰
\ author: 清晨与猫鱼
*/
class ShapeDecorator 
    : public Shape {
public:
    explicit ShapeDecorator(Shape* decoratedShape)
        : decoratedShape_(decoratedShape) {
    }

    void draw() {
        decoratedShape_->draw();
    }

protected:
    unique_ptr<Shape> decoratedShape_;
};


/*
\ brief:  长方形装饰
\ author: 清晨与猫鱼
*/
class RedShapeDecorator 
    : public ShapeDecorator {
public:
    explicit RedShapeDecorator(Shape* decoratedShape)
        : ShapeDecorator(decoratedShape) {            
    };

    void draw() {
        decoratedShape_->draw();
        setRedBorder();
    }

private:
    void setRedBorder() {
        cout << "Border Color: Red" << endl;
    }
};